﻿@namespace BootstrapBlazor.Components
@typeparam TItem
@inherits ValidateBase<TItem>

<div @attributes="AdditionalAttributes" class="@ClassString">
    @if (HeaderTemplate != null)
    {
        @HeaderTemplate
    }
    @if (!string.IsNullOrEmpty(HeaderText))
    {
        <div class="list-group-header">@HeaderText</div>
    }
    <div class="list-group-body scroll">
        @foreach (var item in Items)
        {
            @if (ItemTemplate != null)
            {
                @ItemTemplate(item)
            }
            else
            {
                <div @key="item" class="@GetItemClassString(item)" @onclick="() => OnClick(item)">@GetItemText(item)</div>
            }
        }
    </div>
</div>
